<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse-1">
	<div class="col-sm-3 col-md-3">
		<form class="navbar-form" role="search" onsubmit="return false;">
			<div class="input-group">
				<div id="docsearch"></div>
			</div>
		</form>
	</div>

	<ul class="nav navbar-nav navbar-right">
		{% if page.isGuide %}
		<li class="dropdown">
			<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
				{{ page.title }}
				<span class="caret"></span>
			</a>
			<ul class="dropdown-menu">
					{% assign sortedGuides = site.data.generated_guides[page.version][page.lang] | sort: 'priority' %}
					{% for item in sortedGuides %}
					<li>
						<a href="{{ item.url }}">
							<span>{{ item.title }}</span>
						</a>
					</li>
					{% endfor %}
			</ul>
		</li>
		{% endif %}
		{% if page.version %}
		<li class="dropdown">
			<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
				{{ site.data.versions[page.version].label }}
				<span class="caret"></span>
			</a>
			<ul class="dropdown-menu">
				{% if page.baseUrl != nil && site.data.page_index[page.baseUrl] != nil %}
					{% if site.data.page_index[page.baseUrl]['langIndex'][page.lang] != nil %}
						{% for item in site.data.page_index[page.baseUrl]['langIndex'][page.lang] %}
						<li>
							<a href="/{{ item }}/{{page.lang}}{{page.baseUrl}}">
								<span>{{ site.data.versions[item].label }}</span>
							</a>
						</li>
						{% endfor %}
					{% endif %}
				{% else %}
					{% for item in site.data.versions %}
					<li>
						<a href="/{{ item[0] }}" alt="{{ item[1].label }}">
							<span>{{ item[1].label }}</span>
						</a>
					</li>
					{% endfor %}
				{% endif %}
			</ul>
		</li>
		{% endif %}
		{% if page.lang %}
		<li class="dropdown">
			<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
				{{ site.data.generated_languages[page.lang].label }}

				<span class="caret"></span>
			</a>
			<ul class="dropdown-menu">
				{% if page.baseUrl != nil && site.data.page_index[page.baseUrl] != nil %}
					{% if site.data.page_index[page.baseUrl]['versionIndex'][page.version] != nil %}
						{% for item in site.data.page_index[page.baseUrl]['versionIndex'][page.version] %}
						<li>
							<a href="/{{ page.version }}/{{item}}{{page.baseUrl}}">
								<span>{{ site.data.language_definitions[item].label }}</span>
							</a>
						</li>
						{% endfor %}
					{% endif %}
				{% else %}
					{% for item in site.data.generated_languages %}
					<li>
						<a href="/{{page.version}}/{{ item[0] }}" alt="{{ item[1].label }}">
							<span>{{ item[1].label }}</span>
						</a>
					</li>
					{% endfor %}
				{% endif %}
			</ul>
		</li>
		{% endif %}
	</ul>
</div>

<!-- /.navbar-collapse -->
